package com.uxin.cameratest;

import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;

import android.app.Activity;
import android.content.Intent;
import android.graphics.SurfaceTexture;
import android.hardware.Camera;
import android.os.Bundle;
import android.util.Log;
import android.view.Display;
import android.view.Surface;
import android.view.TextureView;
import android.view.View;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.Toast;

import java.io.IOException;

public class MainActivity extends Activity implements View.OnClickListener{
    public static final String TAG = "MainActivity";

    private Button mBtnTest1;
    private Button mBtnTest2;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        mBtnTest1 = findViewById(R.id.btn_test1);
        mBtnTest1.setOnClickListener(this);

        mBtnTest2 = findViewById(R.id.btn_test2);
        mBtnTest2.setOnClickListener(this);
    }

    @Override
    public void onClick(View view) {
        switch (view.getId()){
            case R.id.btn_test1:
                Intent i = new Intent(this,DefaultCameraActivity.class);
                startActivity(i);
                break;
            case R.id.btn_test2:
                Intent ii = new Intent(this,TextureFromCameraActivity.class);
                startActivity(ii);
                break;
        }
    }
}